home *** CD-ROM | disk | FTP | other *** search
/ GameStar 2006 February / Gamestar_81_2006-02_dvd.iso / Red Shark / Common / SovietTank.script < prev    next >
Text File  |  2001-10-22  |  3KB  |  128 lines

  1. //-------------------------------------------------------------------
  2. //
  3. //  This code is copyright 2001 by G5 Software.
  4. //  Any unauthorized usage, either in part or in whole of this code
  5. //  is strictly prohibited. Violators WILL be prosecuted to the
  6. //  maximum extent allowed by law.
  7. //
  8. //-------------------------------------------------------------------
  9.  
  10. class CSovietTankMesh
  11. {
  12.   string MeshFile = "Models/S_Tank.mesh";
  13.   string SkinFile = "Models/S_Tank.skin";
  14.   string AnimFile = "Models/S_Tank.anim";
  15. }
  16.  
  17. class CSovietTankStateControl extends CMobileGroundUnitStateControl
  18. {
  19.   void CSovietTankStateControl()
  20.   {
  21.     CMobileGroundUnitStateControl(1000.0);
  22.     m_DestroyPause = 7.5;
  23.     m_ExplosionId  = "EXPLID_SovietTankExplosion";
  24.   }
  25. }
  26.  
  27. class CSovietTankTargetingAnimator
  28. {
  29.   string HorAnimName    = "tower";
  30.   string VerAnimName    = "gun";
  31.  
  32.   float  LeftEndAngle   = -180.0;
  33.   float  RightEndAngle  =  180.0;
  34.   float  TopEndAngle    = -10.0;
  35.   float  BottomEndAngle =  30.0;
  36.  
  37.   float  MaxAngleSpeed  = 90.0;
  38. }
  39.  
  40. class CSovietTankGun extends CBaseWeaponDescriptor
  41. {
  42.   int    AmmoQuantity      = -1;
  43.   float  BulletSpeed       = 500.0;
  44.   float  FireDeviation     = 0.005;
  45.   string BulletPatternId   = "BULLETID_SovietTankGunBullet";
  46.   string LinkJointName     = "_Gun_Fire_01";
  47.   string EffectOnFire      = "EFFECTID_TankGunFireEffect";
  48.   string FireCloudEffect   = "EFFECTID_TankGunFireCloudEffect";
  49.   string SoundOnFire       = "SOUNDID_TankGunFireSound";
  50.  
  51.   string WeaponName        = "Gun";
  52.   float  FireWeaponDelay   = 0.8;
  53.   bool   IsAutotargeting   = false;
  54.   int    AttachSlotNumber  = 1;
  55. }
  56.  
  57. class CSovietTankBehavior extends
  58.     CBaseBehavior, CSovietTankMoveParameters, CSovietTankFireParameters
  59. {
  60.   void CSovietTankBehavior()
  61.   {
  62.     CBaseBehavior();
  63.   }
  64. }
  65.  
  66. class CSovietTankMoveParameters
  67. {
  68.   boolean  CanMove = true;
  69.  
  70.   float  MaxSpeed              = 14;   // m/s
  71.   float  MaxAngleSpeed         = 3;    // rad/s
  72.   float  MaxAccelleration      = 15;   // m/(s*s)
  73.   float  MaxAngleAccelleration = 10;   // rad/(s*s)
  74.  
  75.   float  MoveBank     = -.03; //#TMP:
  76.   float  RotationBank = .006;   //#TMP:
  77. }
  78.  
  79. class CSovietTankFireParameters
  80. {
  81.   boolean  CanFire = true;
  82.  
  83.   int  FirePeriod        = 4000; // ms
  84.   int  FirePeriodRandAdd = 3000; // ms
  85.  
  86.   int  ShootGunNum = 1;
  87.  
  88.   boolean  BurstFire = false;
  89.  
  90. // radar
  91.  
  92.   boolean  HasRadar = true;
  93.  
  94.   float  MaxRadarDistance = 500; // m
  95.   float  MinRadarDistance = 1;   // m
  96.  
  97.   int    UpdateRadarPeriod        = 3000; // ms
  98.   int    UpdateRadarPeriodRandAdd = 1000; // ms
  99.  
  100.   boolean  FireFlying = false;
  101.   boolean  FireGround = true;
  102. };
  103.  
  104. class CSovietTank extends
  105.   CGroundUnit,
  106.   CArmedUnit,
  107.   CUnitWithSound,
  108.   CUnitWithCamera,
  109.   CUnitWithStateControl,
  110.   CUnitWithBehavior
  111. {
  112.   void CSovietTank()
  113.   {
  114.     InitializeModelAsAnimated("CSovietTankMesh");
  115.     CUnitWithStateControl("CSovietTankStateControl");
  116.     InitializeSound("CSovietTankEngineSound");
  117.  
  118.     CreateAnimatedWeapon("Weapon", "CSovietTankGun", "CSovietTankTargetingAnimator");
  119.  
  120.     InitializeVehicleBehavior("CSovietTankBehavior");
  121.  
  122.     Core_AddClassificator("Russian");
  123.     Core_AddClassificator("Tank");       // for cockpit identification
  124.     Core_AddClassificator("GroundUnit"); // for behavior fire logic
  125.   }
  126. }
  127.  
  128.